# PRD.gd（伪随机分布算法类）
class_name PRD

const PRD_C = 0.3  # 基础概率系数

static func get_actual_probability(n: int) -> float:
	return min(1.0, n * PRD_C)

static func should_trigger(n_attempts: int) -> bool:
	var p = get_actual_probability(n_attempts)
	return randf() <= p

static func calculate_guarantee_threshold(desired_prob: float) -> int:
	return ceil((1.0 / PRD_C) * (1.0 - sqrt(1.0 - desired_prob)))
